#include "Cat.h"

#include <iostream>

using namespace std;

void Cat::_copy(const Cat& cat) {
    size = cat.size;
    family = new Cat*[cat.size];
    for (int i = 0; i < size; i++) {
        family[i] = cat.family[i];
    }
    return;
}
Cat::Cat(const Cat& cat) : name(cat.name), family(nullptr), size(0) {
    _copy(cat);
}
Cat& Cat::operator=(const Cat& cat) {
    if (this != &cat) {
        name = cat.name;
        size = cat.size;
        delete[] family;
        _copy(cat);
    }
    return *this;
}
